.class public Lcom/instagram/android/widget/j;
.super Landroid/app/Dialog;
.source "IgFacebookOpenGraphDialog.java"


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter

    .prologue
    .line 27
    sget v0, Lcom/facebook/bb;->IgDialog:I

    invoke-direct {p0, p1, v0}, Landroid/app/Dialog;-><init>(Landroid/content/Context;I)V

    .line 28
    sget v0, Lcom/facebook/ax;->layout_facebook_opengraph:I

    invoke-virtual {p0, v0}, Lcom/instagram/android/widget/j;->setContentView(I)V

    .line 29
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/instagram/android/widget/j;->setCancelable(Z)V

    .line 30
    return-void
.end method

.method public static a(Landroid/content/Context;Landroid/support/v4/app/aj;)V
    .locals 5
    .parameter
    .parameter

    .prologue
    const/4 v4, 0x0

    .line 99
    const-string v0, "instagram_facebook_og_dialog"

    invoke-static {v0}, Lcom/instagram/m/b/a/a;->a(Ljava/lang/String;)Landroid/content/SharedPreferences;

    move-result-object v0

    .line 101
    invoke-static {}, Lcom/instagram/service/a;->a()Lcom/instagram/service/a;

    move-result-object v1

    invoke-virtual {v1}, Lcom/instagram/service/a;->d()Z

    move-result v1

    if-eqz v1, :cond_0

    const-string v1, "facebook_og_dialog10"

    invoke-interface {v0, v1}, Landroid/content/SharedPreferences;->contains(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 111
    :cond_0
    :goto_0
    return-void

    .line 104
    :cond_1
    const-string v1, "facebook_og_photo_count"

    invoke-interface {v0, v1, v4}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v1

    const/4 v2, 0x3

    if-ge v1, v2, :cond_2

    .line 106
    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v1

    const-string v2, "facebook_og_photo_count"

    const-string v3, "facebook_og_photo_count"

    invoke-interface {v0, v3, v4}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v0

    add-int/lit8 v0, v0, 0x1

    invoke-interface {v1, v2, v0}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    goto :goto_0

    .line 109
    :cond_2
    const/4 v1, 0x0

    invoke-static {p0, p1, v1, v0}, Lcom/instagram/android/widget/j;->a(Landroid/content/Context;Landroid/support/v4/app/aj;Ljava/lang/Runnable;Landroid/content/SharedPreferences;)V

    goto :goto_0
.end method

.method public static a(Landroid/content/Context;Landroid/support/v4/app/aj;Ljava/lang/Runnable;)V
    .locals 2
    .parameter
    .parameter
    .parameter

    .prologue
    .line 34
    const-string v0, "instagram_facebook_og_dialog"

    invoke-static {v0}, Lcom/instagram/m/b/a/a;->a(Ljava/lang/String;)Landroid/content/SharedPreferences;

    move-result-object v0

    .line 36
    invoke-static {}, Lcom/instagram/service/a;->a()Lcom/instagram/service/a;

    move-result-object v1

    invoke-virtual {v1}, Lcom/instagram/service/a;->d()Z

    move-result v1

    if-eqz v1, :cond_0

    const-string v1, "facebook_og_dialog10"

    invoke-interface {v0, v1}, Landroid/content/SharedPreferences;->contains(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 38
    :cond_0
    if-eqz p2, :cond_1

    .line 39
    invoke-interface {p2}, Ljava/lang/Runnable;->run()V

    .line 44
    :cond_1
    :goto_0
    return-void

    .line 43
    :cond_2
    invoke-static {p0, p1, p2, v0}, Lcom/instagram/android/widget/j;->a(Landroid/content/Context;Landroid/support/v4/app/aj;Ljava/lang/Runnable;Landroid/content/SharedPreferences;)V

    goto :goto_0
.end method

.method private static a(Landroid/content/Context;Landroid/support/v4/app/aj;Ljava/lang/Runnable;Landroid/content/SharedPreferences;)V
    .locals 7
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 48
    invoke-interface {p3}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    const-string v1, "facebook_og_dialog10"

    const/4 v2, 0x1

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 50
    new-instance v4, Lcom/instagram/android/widget/j;

    invoke-direct {v4, p0}, Lcom/instagram/android/widget/j;-><init>(Landroid/content/Context;)V

    .line 51
    sget v0, Lcom/facebook/aw;->layout_facebook_opengraph_textview_sameple:I

    invoke-virtual {v4, v0}, Lcom/instagram/android/widget/j;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    .line 52
    const-string v1, "<b>Johhny Appleseed</b> liked a photo on Instagram"

    invoke-static {v1}, Landroid/text/Html;->fromHtml(Ljava/lang/String;)Landroid/text/Spanned;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 54
    sget v0, Lcom/facebook/aw;->layout_facebook_opengraph_button_no:I

    invoke-virtual {v4, v0}, Lcom/instagram/android/widget/j;->findViewById(I)Landroid/view/View;

    move-result-object v0

    new-instance v1, Lcom/instagram/android/widget/k;

    invoke-direct {v1, v4, p2}, Lcom/instagram/android/widget/k;-><init>(Lcom/instagram/android/widget/j;Ljava/lang/Runnable;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 64
    new-instance v3, Lcom/instagram/android/widget/l;

    invoke-direct {v3, p0}, Lcom/instagram/android/widget/l;-><init>(Landroid/content/Context;)V

    .line 81
    sget v0, Lcom/facebook/aw;->layout_facebook_opengraph_button_yes:I

    invoke-virtual {v4, v0}, Lcom/instagram/android/widget/j;->findViewById(I)Landroid/view/View;

    move-result-object v6

    new-instance v0, Lcom/instagram/android/widget/m;

    move-object v1, p0

    move-object v2, p1

    move-object v5, p2

    invoke-direct/range {v0 .. v5}, Lcom/instagram/android/widget/m;-><init>(Landroid/content/Context;Landroid/support/v4/app/aj;Lcom/instagram/android/d/j/a;Lcom/instagram/android/widget/j;Ljava/lang/Runnable;)V

    invoke-virtual {v6, v0}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 94
    invoke-virtual {v4}, Lcom/instagram/android/widget/j;->show()V

    .line 95
    return-void
.end method
